﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:primitives="clr-namespace:Microsoft.Windows.Controls.Primitives;assembly=WPFToolkit" 
    xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit">

    <SolidColorBrush x:Key="TextBrush" Color="AliceBlue"/>

    <ControlTemplate x:Key="ButtonTemplate" TargetType="{x:Type Button}">
        <Border Name="border" BorderBrush="Aqua" BorderThickness="3">
            <Grid>
                <Rectangle Name="rect" Fill="Brown"></Rectangle>
                <Ellipse Name="eclipse" Fill="Red"></Ellipse>
                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="rect" Property="Fill" Value="AliceBlue"></Setter>
                <Setter TargetName="border" Property="BorderBrush" Value="Red"></Setter>
                <Setter TargetName="eclipse" Property="Fill" Value="Yellow"></Setter>
            </Trigger>
            <!--<EventTrigger RoutedEvent="Button.Click">
                <BeginStoryboard>
                    <Storyboard AutoReverse="True">
                        <DoubleAnimation To="0" Duration="0:0:0.1"
                          Storyboard.TargetProperty="Width"/>
                        <DoubleAnimation To="0" Duration="0:0:0.1"
                          Storyboard.TargetProperty="Height"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>-->
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="Button">
        <Style.Setters>
        <Setter Property="Template" Value="{StaticResource ButtonTemplate}"></Setter>
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}"></Setter>
        <Setter Property="FontSize" Value="16"></Setter>
        <Setter Property="FontWeight" Value="Bold"></Setter>            
        </Style.Setters>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="true">
                <Setter Property="FontSize" Value="20"></Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <Style TargetType="{x:Type Grid}">
        <Setter Property="Background" Value="{DynamicResource TextBrush}">
        </Setter>
    </Style>
</ResourceDictionary>